{include file="header.html"}
<style>
.infoTable label {
  display: block;
  height: 25px;
  line-height: 25px;
  margin-left: 5px;
  color: #444;
}
</style>
<script type="text/javascript">
$(function(){
    checktel();
    $('#user_form').validate({
        errorPlacement: function(error, element){
            $(element).next('.field_notice').hide();
            //$(element).after(error);
        },
        success       : function(label){
            label.addClass('right').text('OK!');
        },
        onkeyup    : false,
        rules : {
            user_name : {
                required : true,
                byteRange: [3,15,'{$charset}'],
                remote   : {
                    url :'index.php?app=user_sub&act=check_user',
                    type:'get',
                    data:{
                        user_name : function(){
                            return $('#user_name').val();
                        },
                        id : '{$user.user_id}'
                    }
                }
            },
            password: {
                <!--{if $smarty.get.act eq 'add'}-->
                required : true,
                <!--{/if}-->
                maxlength: 20,
                minlength: 6
            },
            email   : {
                required : true,
                email : true
            }
        },
        messages : {
            user_name : {
                required : '{$lang.user_not_empty}',
                byteRange: '{$lang.user_length_limit}',
                remote   : '{$lang.name_exist}'
            },
            password : {
                <!--{if $smarty.get.act eq 'add'}-->
                required : '{$lang.password_empty}',
                <!--{/if}-->
                maxlength: '{$lang.password_limit}',
                minlength: '{$lang.password_limit}'
            },
            email  : {
                required : '{$lang.email_not_empty}',
                email   : '{$lang.currect_email}'
            }
        }
    });

});
function  checktel(){ 
	 $("#phone_tel").blur(function(){		 
		 var sMobile = document.user_form.phone_tel.value 			 
		 var telReg = !!sMobile.match(/^(0|86|17951)?(13[0-9]|15[012356789]|17[0-9]|18[0-9]|14[57])[0-9]{8}$/);
		 if(telReg == false){
                $(this).addClass("error");
		        document.user_form.phone_tel.focus(); 
		        return false; 
		    }
     });
}
</script>
<div id="rightTop">
  <p>{$lang.user}</p>
  <ul class="subnav">
    <li><a class="btn1" href="index.php?app=user_sub">{$lang.manage}</a></li>
    <li>
      <!-- {if $user.user_id} -->
        <a class="btn1" href="index.php?app=user_sub&amp;act=add">{$lang.edit}</a>
      <!-- {else} -->
        <span>{$lang.add}</span>
      <!-- {/if} -->
    </li>
  </ul>
</div>
<div class="info">
  <form method="post" enctype="multipart/form-data" id="user_form" name="user_form">
    <table class="infoTable">
      <tr>
          <input class="infoTableInput2" name="type" type="hidden" value="{$user.type}" />
        <th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b> {$lang.user_name}:</th>
        <td class="paddingT15 wordSpacing5">
            <!-- {if $user.user_id} -->
            {$user.user_name|escape}
            <!-- {else} -->
            <input class="infoTableInput2" id="user_name" placeholder="3-25位,必填" type="text" name="user_name" value="{$user.user_name|escape}" />
            <!-- {/if} -->
        </td>
      </tr>
      <tr>
        <th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>{$lang.password}:</th>
        <td class="paddingT15 wordSpacing5">
            <input class="infoTableInput2" name="password" type="text" id="password" value=""/>
            <!-- {if $user.user_id} -->
            <span class="grey">{$lang.note_password}</span>
            <!-- {/if} -->
        </td>
      </tr>
       <tr>
            <th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>手机:</th>
            <td class="paddingT15 wordSpacing5">
                <input class="infoTableInput2" name="phone_tel" type="text" id="phone_tel" value="{$user.phone_tel|escape}" />
            </td>
      </tr>
      
      <tr>
        <th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>{$lang.email}:</th>
        <td class="paddingT15 wordSpacing5"><input class="infoTableInput2" name="email" type="text" id="email" value="{$user.email|escape}" />
            </td>
      </tr>
      <tr>
        <th class="paddingT15"> {$lang.real_name}:</th>
        <td class="paddingT15 wordSpacing5"><input class="infoTableInput2" name="real_name" type="text" id="real_name" value="{$user.real_name|escape}" />        </td>
      </tr>
      <tr>
        <th class="paddingT15"> {$lang.gender}:</th>
        <td class="paddingT15 wordSpacing5"><p>
            <label>
            <input name="gender" type="radio" value="0" {if $user.gender == 0}checked="checked"{/if} />
            {$lang.unknown}</label>
            <label>
            <input type="radio" name="gender" value="1" {if $user.gender == 1}checked="checked"{/if} />
            {$lang.male}</label>
            <label>
            <input type="radio" name="gender" value="2" {if $user.gender == 2}checked="checked"{/if} />
            {$lang.female}</label>
          </p>
        </td>
      </tr>
        <tr>
            <th class="paddingT15">查看组信息 :</th>
            <td class="paddingT15 wordSpacing5">
                <label>
                    <input name="giveauth" type="radio" value="0" {if $user.giveauth == 0}checked="checked"{/if} />
                    否</label>
                <label>
                    <input name="giveauth" type="radio" value="1" {if $user.giveauth == 1}checked="checked"{/if} />
                    是</label>
            </td>
        </tr>
      <tr>
        <th></th>
        <td class="ptb20"><input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
          <input class="formbtn" type="reset" name="Reset" value="{$lang.reset}" />        </td>
      </tr>
    </table>
  </form>
</div>
<div style="display: none"  >
    <div id="hzlist">
        <iframe id="hzframe" width="" height="600px" frameborder="0" scrolling="no"></iframe>
    </div>
</div>
<div style="display: none"  >
    <div id="oplist">
        <iframe id="opframe" width="" height="600px" frameborder="0" scrolling="no"></iframe>
    </div>
</div>
{include file="footer.html"}